import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:paly_android/ui/home_page.dart';
import 'package:paly_android/ui/home_page_sliver.dart';
import 'package:paly_android/ui/project_page.dart';
import 'package:paly_android/ui/sys_page.dart';
import 'package:paly_android/ui/work_page.dart';

import 'main_bloc.dart';

class MianPage extends StatefulWidget {
  MianPage({Key? key}) : super(key: key);

  @override
  _MianPageState createState() {
    return _MianPageState();
  }
}

class _MianPageState extends State<MianPage> {
  late var _pages;

  @override
  void initState() {
    _pages = [HomeSliverPage(), ProjectPage(), WorkPage(), SysPage()];
  }
  @override
  void dispose() {
    super.dispose();
  }


  @override
  Widget build(BuildContext context) {

    return BlocBuilder<MainBloc,int>(builder: (context,state){
      return IndexedStack(
        index: state,
        children: _pages,
      );
    });
  }
}



